package mm.test;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletContext;

public class MockSessionImpl extends MockSessionAdapter implements MockSession {
	
	private MockContext context;
	private Map<String, Object> attributes=new HashMap<String, Object>();

	public MockSessionImpl(MockContext context) {
		this.context=context;
	}
	
	public MockRequest createRequest(){
		return new MockRequestImpl(this);
	}

	public ServletContext getServletContext() {
		return (ServletContext)context;
	}

	@Override
	public Object getAttribute(String arg0) {
		return attributes.get(arg0);
	}

	@Override
	public void setAttribute(String arg0, Object arg1) {
		attributes.put(arg0, arg1);
	}

}
